<?php include_once $config ['client_theme_path'].$config ['client_theme'].'/header.php'; ?>
<!-- BEGIN CONTAINER -->
<div id="container">
    <!-- BEGIN MAIN CONTENT -->
    <div id="main_content" class="clearfix">
        <?php
            $rsAttachs = viewAttachFiles();
            $article = viewArtitle();
            $config['site_title'] = $article['title'] . ' - ' . nosignTitle($article['title']) .' - BanTinNhaDat.vn';
            $config['site_description'] = $article['short_description'];
            $config['site_keyword'] = $article['title'] . ',' . nosignTitle($article['title']) .', '. $config['site_keyword'];
        ?>
        <div id="content">
            <div id="pathway">
                <div id="pathway_inside">
                    <img src="<?php echo $config ['client_images_url'];?>/bu_relatedNews.gif" alt="" />
                    <a href="/" title="Trang chủ">Trang chủ</a>
                    <?php echo getPathWay();?>
                </div>
            </div>
            <div class="box_cat marT1">
                <h3><a><?php echo $article['category_name'];?></a></h3>
                <div class="tags">
                    <div class="box_detail">
                        <div class="box_detail_title"><?php echo $article['title'];?></div>
                        <div style="margin-top:5px"><a href="/cata/<?php echo $article['cat_link'];?>" title="<?php echo viewTitleLink($article['category_name']);?>"><?php echo $article['category_name'];?></a>  —  <a href="/<?php echo date("Y",strtotime($article['create_date']));?>/<?php echo date("m",strtotime($article['create_date']));?>" title="<?php echo date("d/m/Y",strtotime($article['create_date']));?>"><?php echo date("d/m/Y",strtotime($article['create_date']));?></a></div>
                        <div class="box_detail_content">
                            <p><?php echo $article['description'];?></p>
                        </div>
                        <?php
                            if($DB->num_rows($rsAttachs)>0){
                        ?>
                        <div style="margin-bottom:10px;">
                            <div style="font-size:14px; font-weight:bold;margin-bottom:5px;">Tải tài liệu:</div>
                            <?php
                                while($rs=$DB->fetch_array($rsAttachs)) {
                                    $arrCode = explode('.', basename($rs['filename']));
                            ?>
                            <div><a href="/download.php?i=<?php echo $rs['id'];?>&c=<?php echo $arrCode[0];?>" title="<?php echo $rs['real_filename'];?>"><?php echo $rs['real_filename'];?></a></div>
                            <?php
                                }
                            ?>
                        </div>
                        <?php
                            }
                        ?>
						<div class="cat_featured_news clearfix">
                        <?php
                            $rsTags = getTagByArticleId($article['id']);
                            if($DB->num_rows($rsTags)>0){

							echo 'Từ khóa:'; 
                            
                                while($rs=$DB->fetch_array($rsTags)) {
                        ?>
                            <a href="/tag/<?php echo $rs['tags_link'];?>" title="<?php echo viewTitleLink($rs['tags']);?>"><?php echo $rs['tags'];?></a>, &nbsp;
                        <?php
                                }
                            }
                        ?>
                        </div>
                    </div>
                </div>
            </div>

            <div class="box_tool_action">
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_facebook.gif" alt="facebook" /></a>
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_twitter.gif" alt="twitter" /></a>
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_google.gif" alt="google" /></a>
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_bookmark.gif" alt="" /></a>
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_print.gif" alt="print" /> In</a>
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_viewreply.gif" alt="view reply" /> Xem phản hồi</a>
                <a href="#"><img src="<?php echo $config ['client_images_url'];?>/ico_viewreply.gif" alt="reply" /> Gửi phản hồi</a>
                <a href="#" class="back"><img src="<?php echo $config ['client_images_url'];?>/ico_back.gif" alt="back" /> Quay lại</a>
            </div>
            <?php
                $rsOtherArticleNewer = ortherNewerArticleInCategory($article['create_date'], $article['cat_id'], 10);
                if($DB->num_rows($rsOtherArticleNewer)>0){
            ?>
            <div class="box_other_news box_newest">
                <h3><a href="#">Các bài mới</a></h3>
                <ul>
                    <?php
                        while($rs=$DB->fetch_array($rsOtherArticleNewer)) {
                    ?>
                    <li><a href="/<?php echo $rs['link'];?>.html" title="<?php echo viewTitleLink($rs['title']);?>"><?php echo $rs['title'];?><img src="<?php echo $config ['client_images_url'];?>/ico_new.gif" alt="<?php echo $rs['title'];?>" /></a></li>
                    <?php
                        }
                    ?>
                </ul>
            </div>
            <?php
                }
            ?>
            <?php
                $rsOtherArticleOlder = ortherOlderArticleInCategory($article['create_date'], $article['cat_id'], 10);
                if($DB->num_rows($rsOtherArticleOlder)>0){
            ?>
            <div class="box_other_news">
                <h3><a href="#">Các bài đã đăng</a></h3>
                <ul>
                    <?php
                        $rsOtherArticleOlder = ortherOlderArticleInCategory($article['create_date'], $article['cat_id'], 10);
                        while($rs=$DB->fetch_array($rsOtherArticleOlder)) {
                    ?>
                    <li><a href="/<?php echo $rs['link'];?>.html" title="<?php echo $rs['title'];?>"><?php echo $rs['title'];?></a></li>
                    <?php
                        }
                    ?>
                </ul>
            </div>
            <?php
                }
            ?>
        </div>

        <?php include_once $config ['client_theme_path'].$config ['client_theme'].'/right_detail.php'; ?>

    </div>
    <!-- END MAIN CONTENT-->
</div>
<!-- END CONTAINER-->

<?php include_once $config ['client_theme_path'].$config ['client_theme'].'/footer.php'; ?>